project(cgm_virtual)

set(virtual_srcs
  CACompositeVG.cpp
  CAPartitionVG.cpp
  CAVirtualVG.cpp
  CollapseAngleTool.cpp
  CollapseCurveTool.cpp
  CompSurfFacets.cpp
  CompositeAttrib.cpp
  CompositeBody.cpp
  CompositeCoEdge.cpp
  CompositeCoSurf.cpp
  CompositeCurve.cpp
  CompositeEngine.cpp
  CompositeGeom.cpp
  CompositeLoop.cpp
  CompositeLump.cpp
  CompositePoint.cpp
  CompositeShell.cpp
  CompositeSurface.cpp
  CompositeTool.cpp
  Faceter.cpp
  FaceterFacetData.cpp
  FaceterPointData.cpp
  HiddenEntitySet.cpp
  ImprintBoundaryTool.cpp
  ImprintLineSegment.cpp
  ImprintPointData.cpp
  PartPTCurve.cpp
  PartSurfFacetTool.cpp
  PartitionBody.cpp
  PartitionCoEdge.cpp
  PartitionCoSurf.cpp
  PartitionCurve.cpp
  PartitionEngine.cpp
  PartitionEntity.cpp
  PartitionLoop.cpp
  PartitionLump.cpp
  PartitionLumpImprint.cpp
  PartitionPoint.cpp
  PartitionShell.cpp
  PartitionSurface.cpp
  PartitionTool.cpp
  RemoveBlends.cpp
  SegmentedCurve.cpp
  SimplifyTool.cpp
  SplitCompositeSurfaceTool.cpp
  SubCurve.cpp
  SubEntitySet.cpp
  SubSurface.cpp
  TDVGFacetOwner.cpp
  TDVGFacetSplit.cpp
  VirtualImprintTool.cpp
  VirtualQueryEngine.cpp)

if (ALPHA_SPLIT_VIRTUAL)
  list(APPEND virtual_srcs
    SplitSurfaceVirtual.cpp)
endif ()

set(extra_virtual_srcs
  AllocMemManagersVirtual.cpp)

set(virtual_headers
  cgm/CACompositeVG.hpp
  cgm/CAPartitionVG.hpp
  cgm/CAVirtualVG.hpp
  cgm/CollapseAngleTool.hpp
  cgm/CollapseCurveTool.hpp
  cgm/CompSurfFacets.hpp
  cgm/CompositeAttrib.hpp
  cgm/CompositeBody.hpp
  cgm/CompositeCoEdge.hpp
  cgm/CompositeCoSurf.hpp
  cgm/CompositeCurve.hpp
  cgm/CompositeEngine.hpp
  cgm/CompositeGeom.hpp
  cgm/CompositeLoop.hpp
  cgm/CompositeLump.hpp
  cgm/CompositePoint.hpp
  cgm/CompositeShell.hpp
  cgm/CompositeSurface.hpp
  cgm/CompositeTool.hpp
  cgm/Faceter.hpp
  cgm/FaceterFacetData.hpp
  cgm/FaceterPointData.hpp
  cgm/HiddenEntitySet.hpp
  cgm/ImprintBoundaryTool.hpp
  cgm/ImprintLineSegment.hpp
  cgm/ImprintMatchData.hpp
  cgm/ImprintPointData.hpp
  cgm/PartPTCurve.hpp
  cgm/PartSurfFacetTool.hpp
  cgm/PartitionBody.hpp
  cgm/PartitionCoEdge.hpp
  cgm/PartitionCoSurf.hpp
  cgm/PartitionCurve.hpp
  cgm/PartitionEngine.hpp
  cgm/PartitionEntity.hpp
  cgm/PartitionLoop.hpp
  cgm/PartitionLump.hpp
  cgm/PartitionLumpImprint.hpp
  cgm/PartitionPoint.hpp
  cgm/PartitionShell.hpp
  cgm/PartitionSurface.hpp
  cgm/PartitionTool.hpp
  cgm/SegmentedCurve.hpp
  cgm/SimplifyTool.hpp
  cgm/SplitCompositeSurfaceTool.hpp
  cgm/SplitSurfaceVirtual.hpp
  cgm/SubCurve.hpp
  cgm/SubEntitySet.hpp
  cgm/SubSurface.hpp
  cgm/TDVGFacetOwner.hpp
  cgm/TDVGFacetSplit.hpp
  cgm/VGArray.cpp
  cgm/VGArray.hpp
  cgm/VGDefines.h
  cgm/VGLoopTool.cpp
  cgm/VGLoopTool.hpp
  cgm/VirtualImprintTool.hpp
  cgm/VirtualQueryEngine.hpp)

include_directories(cgm_virtual
    ${CMAKE_CURRENT_SOURCE_DIR}/cgm
    ${CMAKE_SOURCE_DIR}/src/util/cgm
    ${CMAKE_BINARY_DIR}/src/util/cgm
    ${CMAKE_SOURCE_DIR}/src/geom/cgm
    ${CMAKE_BINARY_DIR}/src/geom/cgm
    ${CMAKE_SOURCE_DIR}/src/geom/Cholla/cgm
    ${CMAKE_SOURCE_DIR}/src/geom/facet/cgm
    ${CMAKE_SOURCE_DIR}/src/geom/facetbool/cgm
)

link_libraries(
    cgm_facet
    cgm_geom
    cgm_util
)
cgm_add_library(cgm_virtual 1 ${virtual_srcs} ${extra_virtual_srcs})

install(
  TARGETS   "cgm_virtual"
  EXPORT    cgm_geom
  RUNTIME   DESTINATION bin
  LIBRARY   DESTINATION lib
  ARCHIVE   DESTINATION lib
  COMPONENT Runtime)

cgm_install_headers(${virtual_headers})

